luci-app-adblock: sync with update 4.4.1-2
authorDirk Brenken <[email protected]>
Sat, 3 May 2025 12:43:28 +0000 (14:43 +0200)
committerDirk Brenken <[email protected]>
Sat, 3 May 2025 12:44:14 +0000 (14:44 +0200)
Small fixes, a uci-defaults script and wording improvements.

Signed-off-by: Dirk Brenken <[email protected]>
applications/luci-app-adblock/htdocs/luci-static/resources/view/adblock/overview.js
applications/luci-app-adblock/root/etc/uci-defaults/95-luci-app-adblock-housekeeping [new file with mode: 0755]

index a17a56f92c09334bc1291d03c61251b9fe37f3e9..6d612fc45243498740bd2cd7d3685286b2714f37 100644 (file)
@@ -19,7 +19,7 @@ function handleAction(ev) {
        }
        if (ev === 'restart' || ev === 'reload') {
                let map = document.querySelector('.cbi-map');
-               dom.callClassMethod(map, 'save')
+               return dom.callClassMethod(map, 'save')
                        .then(L.bind(ui.changes.apply, ui.changes))
                        .then(function () {
                                return fs.exec_direct('/etc/init.d/adblock', [ev]);
@@ -211,11 +211,16 @@ return view.extend({
                o = s.taboption('general', form.Flag, 'adb_enabled', _('Enabled'), _('Enable the adblock service.'));
                o.rmempty = false;
 
-               o = s.taboption('general', widgets.NetworkSelect, 'adb_trigger', _('Startup Trigger Interface'), _('List of available network interfaces to trigger the adblock start. \
-                       Choose \'unspecified\' to use a classic startup timeout instead of a network trigger.'));
+               o = s.taboption('general', widgets.NetworkSelect, 'adb_trigger', _('Startup Trigger Interface'), _('List of available network interfaces to trigger the adblock start.'));
+               o.multiple = true;
                o.nocreate = true;
                o.rmempty = true;
 
+               o = s.taboption('general', form.Value, 'adb_triggerdelay', _('Trigger Delay'), _('Additional trigger delay in seconds before adblock processing begins.'));
+               o.placeholder = '5';
+               o.datatype = 'range(1,300)';
+               o.rmempty = true;
+
                o = s.taboption('general', form.Flag, 'adb_dnsforce', _('Force Local DNS'), _('Redirect all DNS queries from specified zones to the local DNS resolver, applies to UDP and TCP protocol.'));
                o.rmempty = false;
 
@@ -281,11 +286,6 @@ return view.extend({
                o.enabled = '10';
                o.rmempty = true;
 
-               o = s.taboption('additional', form.Value, 'adb_triggerdelay', _('Trigger Delay'), _('Additional trigger delay in seconds before adblock processing begins.'));
-               o.placeholder = '2';
-               o.datatype = 'range(1,300)';
-               o.rmempty = true;
-
                o = s.taboption('additional', form.Value, 'adb_tmpbase', _('Base Temp Directory'), _('Base temp directory for all adblock related runtime operations, \
                        e.g. downloading, sorting, merging etc.'));
                o.placeholder = '/tmp';
@@ -363,11 +363,12 @@ return view.extend({
                o.optional = true;
                o.rmempty = true;
 
-               o = s.taboption('adv_dns', form.Flag, 'adb_jail', _('Additional Jail Blocklist'), _('Builds an additional DNS blocklist to block access to all domains except those listed in the whitelist. \
+               o = s.taboption('adv_dns', form.Flag, 'adb_jail', _('Jail Blocklist'), _('Builds an additional restrictive DNS blocklist to block access to all domains except those listed in the allowlist. \
                        You can use this restrictive blocklist e.g. for guest wifi or kidsafe configurations.'));
                o.rmempty = true;
 
-               o = s.taboption('adv_dns', form.Value, 'adb_jaildir', _('Jail Directory'), _('Target directory for the generated jail blocklist.'));
+               o = s.taboption('adv_dns', form.Value, 'adb_jaildir', _('Jail Directory'), _('Target directory for the generated jail blocklist. \
+                       If this directory points to your DNS directory, the jail blocklist replaces your default blocklist.'));
                o.depends('adb_jail', '1');
                o.placeholder = '/tmp';
                o.rmempty = true;
diff --git a/applications/luci-app-adblock/root/etc/uci-defaults/95-luci-app-adblock-housekeeping b/applications/luci-app-adblock/root/etc/uci-defaults/95-luci-app-adblock-housekeeping
new file mode 100755 (executable)
index 0000000..e6e19f9
--- /dev/null
@@ -0,0 +1,4 @@
+#!/bin/sh
+rm -f /var/luci-indexcache.*.json
+[ -x "/etc/init.d/rpcd" ] && /etc/init.d/rpcd reload
+exit 0